import {BaseApi} from '/@/api-services/apis/baseApi'
import { SysUser, UserAddInput, UserUpdateInput,ChangePwdInput, UserOutput,SysOrg,MenuOutPut } from '/@/api-services/models/system'
import { BaseIdInput } from '/@/api-services/models/base-id-input'

/**
 * 用户管理Api
 */
class UserCenterApi extends BaseApi<SysUser, UserAddInput, UserUpdateInput> {

   errorFileDownload=async(data:BaseIdInput)=>{
      return this.normalGetBlob(`/errorDownload`,data)
   }
   //修改密码
   changePassword=async(data:ChangePwdInput)=>{
      return this.normalPost(`/changePassword`,data)
   }   

   //获取登录用户信息
   loginUserDetail=async()=>{
      return this.normalGet<UserOutput>(`/loginUserDetail`,null)
   }
   //获取登录用户菜单列表
   loginUserMenu=async()=>{
      return this.normalGet<MenuOutPut>(`/loginUserMenu`,null)
   }
   //获取组织列表树
   orgTree=async()=>{
      return this.normalGet<Array<SysOrg>>(`/orgTree`,null)
   }
}

export default new UserCenterApi('/system/userCenter');